#include <EXTERN.h>
#include <perl.h>

int main(int argc, char** argv, char** env) {
   PerlInterpreter *my_perl;
   AV* inc;
   SV** value;
   int i;

   char *switches[] = {"", "-e", "0"};
   my_perl = perl_alloc();
   perl_construct(my_perl);
   perl_parse(my_perl, NULL, 3, switches, (char**)NULL);
   perl_run(my_perl);

   inc = get_av("INC", 0);
   if(NULL != inc) {
      for(i = 0; i <= av_len(inc); i++) {
         value = av_fetch(inc, i, 0);
         if(NULL != value) {
            printf("%s \n", SvPV(*value, PL_na));
         }
      }
   
   perl_destruct(my_perl);
   perl_free(my_perl);
}
